<template>
  <div class="navbar-container flex-col align-center">
    <div class="navbar-content flex-row justify-between">
      <!-- 左侧按钮组 -->
      <div class="left-buttons flex-row">
        <button class="nav-button" @click="goToMainMenu">
          <img
              class="button-icon"
              referrerpolicy="no-referrer"
              src="https://lanhu-oss-proxy.lanhuapp.com/SketchPng910672210df4fe5b9680489a6497751170ff9d7db79ce2ae32d5ad8bd4c62d33"
          />
          <span class="button-text">返回主菜单</span>
        </button>

        <div class="separator">
          <img
              class="separator-image"
              referrerpolicy="no-referrer"
              src="https://lanhu-oss-proxy.lanhuapp.com/SketchPng430baedb334eef13b85eb89bcebc95478e3b57407f5b50c177e6a09d32384a11"
          />
        </div>

        <div class="nav-menu" @click="toggleBasicMaintenance">
          <span class="menu-text">基础维护</span>
          <img
              class="menu-icon"
              referrerpolicy="no-referrer"
              src="https://lanhu-oss-proxy.lanhuapp.com/SketchPng35d89614f92baac31160d4cd2a3ca954c23d170ab53f802905435373f7e0feb4"
          />
          <span class="menu-text">维修管理</span>
        </div>
      </div>

      <!-- 右侧按钮组 -->
      <div class="right-buttons flex-row">
        <button class="nav-button" @click="showHelp">
          <img
              class="button-icon"
              referrerpolicy="no-referrer"
              src="https://lanhu-oss-proxy.lanhuapp.com/SketchPnga0a38a53489fe44f576933cdb3a6874d1f2d6179fc397226811f3f77f5c3cead"
          />
          <span class="button-text">疑问</span>
        </button>

        <button class="nav-button" @click="showMessages">
          <img
              class="button-icon"
              referrerpolicy="no-referrer"
              src="https://lanhu-oss-proxy.lanhuapp.com/SketchPng06c63991386f57ab3d2b29cc666312e617b4ddd6e642ee452449a63085de82df"
          />
          <span class="button-text">消息</span>
          <div class="notification-badge" v-if="messageCount > 0">
            <span class="badge-text">{{ messageCount }}</span>
          </div>
        </button>

        <div class="admin-info" @click="showAdminMenu">
          <span class="admin-text">管理员：123456</span>
          <img
              class="admin-icon"
              referrerpolicy="no-referrer"
              src="https://lanhu-oss-proxy.lanhuapp.com/SketchPng24966365faa3c2a25bb7763ec7c0c5a213bf10dffc49b8e223d04d31512d7103"
          />
        </div>

      </div>
    </div>
  </div>
</template>

<script setup>
import {ref} from 'vue'

// 响应式数据
const messageCount = ref(3)

// 事件处理函数
const goToMainMenu = () => {
  console.log('返回主菜单')
  // 这里可以添加路由跳转逻辑
  // router.push('/')
}

const toggleBasicMaintenance = () => {
  console.log('切换基础维护/用户管理')
  // 这里可以添加切换逻辑
}

const showHelp = () => {
  console.log('显示帮助')
  // 这里可以添加帮助页面逻辑
}

const showMessages = () => {
  console.log('显示消息')
  // 这里可以添加消息页面逻辑
}

const showAdminMenu = () => {
  console.log('显示管理员菜单')
  // 这里可以添加管理员菜单逻辑
}
</script>

<style scoped>
/* 通用flex样式 */
.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.justify-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

/* 主容器样式 */
.navbar-container {
  background-image: url(https://dragonweb-bucket.oss-cn-beijing.aliyuncs.com/gufe-img1.png);
  margin: -1px 0 0 -2px;
  background-position: right;
  width: 100%;
  height: 100%;
}

.navbar-content {
  background: linear-gradient(to right, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.5));
  background-size: 100% 100%;
  margin-top: 1px;
  width: 100%;
  height: 100%;
  padding: 31px 39px 0 35px;
  align-items: flex-start;
}

/* 左侧按钮组 */
.left-buttons {
  margin-left: 40px;
  align-items: center;
  gap: 27px;
}

/* 右侧按钮组 */
.right-buttons {
  margin-right: 40px;
  align-items: center;
  gap: 20px;
}

/* 通用按钮样式 */
.nav-button {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  height: 32px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0;
  transition: all 0.3s ease;
}

.nav-button:hover {
  background-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.nav-button:active {
  transform: translateY(0);
}

/* 按钮图标样式 */
.button-icon {
  margin-left: 16px;
}

/* 按钮文字样式 */
.button-text {
  color: rgba(255, 255, 255, 1);
  font-size: 14px;
  font-weight: normal;
  white-space: nowrap;
  line-height: 20px;
}

/* 返回主菜单按钮特定样式 */
.left-buttons .nav-button:first-child {
  width: 120px;
}

.left-buttons .nav-button:first-child .button-icon {
  width: 13px;
  height: 13px;
  margin-left: 18px;
}

/* 分隔符样式 */
.separator-image {
  width: 1px;
  height: 26px;
}

/* 导航菜单样式 */
.nav-menu {
  background: url(https://lanhu-oss-proxy.lanhuapp.com/SketchPng76ce56e154f3ee7e01d00f00c63e328850378e572f3e79aa343e63fe1f48913c) 100% no-repeat;
  background-size: 100% 100%;
  width: 631px;
  height: 32px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-menu:hover {
  opacity: 0.9;
}

.menu-text {
  color: rgba(255, 255, 255, 1);
  font-size: 14px;
  font-weight: normal;
  white-space: nowrap;
  line-height: 20px;
}

.nav-menu .menu-text:first-child {
  margin-left: 15px;
}

.menu-icon {
  width: 9px;
  height: 10px;
  margin: 0 11px;
}

.nav-menu .menu-text:last-child {
  margin-right: auto;
}

/* 疑问按钮样式 */
.right-buttons .nav-button:first-child {
  width: 80px;
}

.right-buttons .nav-button:first-child .button-icon {
  width: 14px;
  height: 14px;
}

.right-buttons .nav-button:first-child .button-text {
  margin: 0 16px 0 0;
}

/* 消息按钮样式 */
.right-buttons .nav-button:nth-child(2) {
  width: 80px;
  position: relative;
}

.right-buttons .nav-button:nth-child(2) .button-icon {
  width: 12px;
  height: 15px;
  margin-left: 17px;
}

/* 消息徽章样式 */
.notification-badge {
  background-color: rgba(231, 59, 69, 1);
  border-radius: 50%;
  height: 14px;
  width: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 1px 0 2px;
}

.badge-text {
  color: rgba(255, 255, 255, 1);
  font-size: 10px;
  font-weight: normal;
  line-height: 14px;
}

/* 管理员信息样式 */
.admin-info {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  width: 173px;
  height: 32px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-info:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.admin-text {
  color: rgba(255, 255, 255, 1);
  font-size: 14px;
  font-weight: normal;
  white-space: nowrap;
  line-height: 20px;
  margin-left: 38px;
}

.admin-icon {
  width: 9px;
  height: 5px;
  margin: 0 11px 0 11px;
}
</style>